import logging
import unittest

from config import BASE_DIR
from scripts.test_ihrm_adduser import TestIhrmAdduser
from scripts.test_Ihrm_login import TestihrmLogin
from htmltestreport import HTMLTestReport
import os
from common.logggin_user import init_log_config
# 绝对路径 os.path.dirname(__file__)
# BASE_DIR=os.path.dirname(os.path.abspath(__file__))

init_log_config(BASE_DIR + "/loggin/ihrm_test01.log")
suite = unittest.TestSuite()
logging.debug("测试套件容器实例,创建成功!")
load = unittest.TestLoader()
logging.debug("测试套件加载器实例,创建成功!")
suite.addTest(load.loadTestsFromTestCase(TestIhrmAdduser))
suite.addTest(load.loadTestsFromTestCase(TestihrmLogin))


run_adduser = HTMLTestReport(BASE_DIR + "/report/ihrm.html")
run_adduser.run(suite)